package com.bestcem.xm.deliver.grpc.client.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
public class MemberProjectDto {

    @JsonProperty("id")
    private String id;

    @JsonProperty("orgId")
    private String orgId;

    @JsonProperty("mid")
    private String memberId;

    @JsonProperty("m_project_name")
    private String name;

    @JsonProperty("m_project_code")
    private String code;

    @JsonProperty("m_p_status")
    private String status;

    @JsonProperty("project_manager_mobile")
    private String managerPhone;

    @JsonProperty("m_p_type")
    private String type;

    @JsonProperty("contractNo")
    private String contractNo;

    @JsonProperty("contract_obj")
    private String contractObj;

    @JsonProperty("contract_money")
    private Integer contractMoney;

    @JsonProperty("account_manager")
    private String accountManager;

    @JsonProperty("project_manager")
    private String projectManager;

    @JsonProperty("project_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime projectTime;

    @JsonProperty("program_start")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime programStartTime;

    @JsonProperty("actual_start")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime actualStartTime;


    @JsonProperty("acceptance_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime acceptanceTime;

    @JsonProperty("finish_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @JsonProperty("field_val_list")
    private List<MemberProjectDto.MemberProjectExtendFieldValueDto> fieldValuesList;

    @Data
    @NoArgsConstructor
    public static class MemberProjectExtendFieldValueDto {
        @JsonProperty("org_id")
        private String orgId;

        @JsonProperty("id")
        private String id;

        @JsonProperty("name")
        private String name;

        @JsonProperty("type")
        private Integer type;

        @JsonProperty("member_type")
        private Integer memberType;
    }
}
